<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .box ul{
            overflow: hidden;
        }
        li {
            list-style: none;
            font-size: 40px;
            float: left;
            margin-right: 20px;
        }
    </style>
</head>
<body>
    <div class="box">
        <ul>
            <li>☆</li>
            <li>☆</li>
            <li>☆</li>
            <li>☆</li>
            <li>☆</li>
        </ul>
    </div>
    <script src='../jquery-1.12.4.js'></script>
    <script>
        $(function(){
            $('li').on('mouseenter',function(){
                $(this).text('★').prevAll().text('★').end().nextAll('★');
                $(this).mouseleave(function(){$(this).text('☆')})
            })
            $('ul').on(
                {'mouseleave':function(){
                    $('li').text('☆')
                    }
                }
            )
        })
    </script>
</body>
</html>